package com.timous.数组;

/**
 * https://leetcode-cn.com/problems/unique-number-of-occurrences/
 */
public class _1207_独一无二的出现次数 {
    public static boolean uniqueOccurrences(int[] arr) {
        int[] result = new int[2000];
        for (int i = 0; i < arr.length; i++) {
            result[arr[i]+1000]++;
        }
        for (int i = 0; i < result.length; i++) {
            for (int j = 0; j < result.length; j++) {
                if(result[i] == result[j] && i != j){
                    return false;
                }
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int[] arr = new int[]{1,2,2,1,1,3};
        System.out.println(uniqueOccurrences(arr));
    }
}
